OBJS= improvedeuler.o bat.o lqregulator_motor2.o SMA2.o odefunc.o

motor=-Ddcmotor
nomotor=-Dnodcmotor
one_controllers=-Done_controllers

cllnx: dyncorec.o $(OBJS)
	g++ -o dyncorec dyncorec.o $(OBJS) newmat/libnewmat.a -lm
clean:
	rm $(OBJS)

#Ode function
odefunc.o: dynlib.h ./odefunc.cpp
	g++ -c ./odefunc.cpp  $(one_controllers) $(motor)
#Dyncore
dyncorec.o: dynlib.h dyncorec.cpp
	g++ -c dyncorec.cpp 
#Dc motors lib.
SMA2.o: dynlib.h ./dynmodels/dcmotors/SMA2.cpp
	g++ -c ./dynmodels/dcmotors/SMA2.cpp 
#Ode solvers.
improvedeuler.o: dynlib.h ./odesolvers/improvedeuler.cpp
	g++ -c ./odesolvers/improvedeuler.cpp 
#Dynmodels.
bat.o: dynlib.h ./dynmodels/bat/bat.cpp
	g++ -c ./dynmodels/bat/bat.cpp 
#controller.
lqregulator_motor2.o: dynlib.h ./controlaws/bat/lqregulator_motor2.cpp
	g++ -c ./controlaws/bat/lqregulator_motor2.cpp 
